package com.example.student.dao;

import com.example.student.entity.User;

/**
 * @author TonySong
 * @date 2025/8/7 0007
 * @time 19:21
 */
public interface UserDao extends  IGenericDao<User,Integer>{
    String FIND_USERS="SELECT * FROM t_user";
    String PAGE_USERS = "SELECT * FROM t_user ORDER BY id DESC LIMIT ?,? ";

    String DELETE_USER="UPDATE t_user SET is_del=1 WHERE id=?";
    String FIND_USER ="SELECT * FROM t_user WHERE id=?";
    String INSERT_USER ="INSERT INTO t_user(username,password,create_time,update_time,is_del) VALUES(?,?,now(),now(),0)" ;
    String INSERT_USER_AVATAR ="INSERT INTO t_user(username,password,create_time,update_time,is_del,avatar) VALUES(?,?,now(),now(),0,?)" ;
    String UPDATE_USER = "UPDATE t_user SET username=?,password=?,update_time=now() WHERE id=?";
    String UPDATE_USER_AVATAR = "UPDATE t_user SET username=?,password=?,update_time=now(),avatar=? WHERE id=?";
    String LOGIN_USER = "SELECT * FROM t_user WHERE username=? AND password=?";
    String HAS_USERNAME = "SELECT COUNT(id) FROM t_user WHERE username=?";
}
